package com.renwei.yunlong.utils;

import android.content.Context;
import android.content.SharedPreferences;

import static android.R.attr.id;

/**
 * SharePreference 封装
 *
 * Created by Administrator on 2017/8/22.
 */

public class PrefUtils {
    public static boolean getBoolean(Context context, String  key, boolean defValue){
        SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);

        return sp.getBoolean(key, defValue);
    }

    public static void setBoolean(Context context,String key,boolean value){

        SharedPreferences sp = context.getSharedPreferences("config", Context.MODE_PRIVATE);

        sp.edit().putBoolean(key, value).commit();//提交
    }
}
